package com.yuanfeng.base.controller;


import com.yuanfeng.base.dto.DealerApplyInfoDTO;
import com.yuanfeng.commoms.dto.base.DealerApplyDTO;
import com.yuanfeng.commoms.dto.base.DealerGoodsUserInfoDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.commoms.vo.base.DealerApplyInfoVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName BaseDealerApplyInfoController
 * @Description 分销商申请信息表
 * @Author cyp
 * @Date 2023-05-25 15:41:43
 * @Version 1.0
 **/
@RestController
@RequestMapping("base/dealerApplyInfo")
public class BaseDealerApplyInfoController extends BaseController {
    /**
     * 查询店铺是否需要经销审核
     *
     * @param goodsUserInfo
     * @return
     */
    @PostMapping("/queryDealerApplyByShop")
    public DealerApplyInfoVO queryDealerApplyByShop(@RequestBody DealerGoodsUserInfoDTO goodsUserInfo) {
        return baseDealerApplyInfoService.queryDealerApplyByShop(goodsUserInfo);
    }
    /**
     * 经销申请
     * @param dealerApply
     * @return
     */
    @PostMapping("/applyDealer")
    public ResponseResult applyDealer(@RequestBody DealerApplyDTO dealerApply){
        return baseDealerApplyInfoService.applyDealer(dealerApply);
    }

    /**
     *查询经销商列表
     * @param map
     * @return
     */
    @PostMapping("/query/dealerShopInfo")
    public ResponseResult queryDealerShopInfo(@RequestBody Map<String,Object> map) {
        ResponseResult result=baseDealerApplyInfoService.queryDealerShopInfo(map);

        return result;
    }

    /**
     * 修改分销商申请信息(店铺名)
     *
     * @param map
     * @return
     */
    @PostMapping("/updateDealerApplyInfo")
    public ResponseResult updateDealerApplyInfotByMap(@RequestBody Map<String, Object> map) {
        ResponseResult result = baseDealerApplyInfoService.updateDealerApplyInfotByMap(map);
        return result;
    }
    /**
     * 商家申请供应商店铺分类页数据获取
     * @param dealerApply
     * @return
     */
    @PostMapping("queryDealerClassInfo")
    public ResponseResult queryDealerClassInfo(@RequestBody DealerApplyInfoDTO dealerApply){
        ResponseResult result = baseDealerApplyInfoService.queryDealerClassInfo(dealerApply);
        return result;
    }

    /**
     * 查询经销商
     * @param dealerApplyInfo
     * @return
     */
    @PostMapping("/queryDealerList")
    public ResponseResult queryDealerList(@RequestBody  DealerApplyInfoDTO dealerApplyInfo){
        return baseDealerApplyInfoService.queryDealerList(dealerApplyInfo);
    }

    /**
     * 操作经销商
     * @param dealerApplyInfo
     * @return
     */
    @PostMapping("/operateDealerApply")
    public ResponseResult operateDealerApply(@RequestBody DealerApplyInfoVO dealerApplyInfo){
        return baseDealerApplyInfoService.operateDealerApply(dealerApplyInfo);
    }
}
